import service from "@/utils/request";

export type Result = {
    code: number;
    msg?: string;
    data?: any;
}

//获取用户列表
export function getUserList(data?: any): Promise<any> {
    return service.request<Result>({method: "get", url: "/user/list", params: data});
}

//修改用户权限
export function changeUserRole(data?: any): Promise<any> {
    return service.request<Result>({method: "post", url: "/user/editUserRole", data: data})
}

//修改用户权限
export function changeUserPhone(data?: any): Promise<any> {
    return service.request<Result>({method: "post", url: "/user/editUserPhone", data: data})
}

//修改用户权限
export function changeUserEmail(data?: any): Promise<any> {
    return service.request<Result>({method: "post", url: "/user/editUserEmail", data: data})
}

//删除用户
export function deleteUserById(data?: any): Promise<any> {
    return service.request<Result>({method: "get", url: "/user/delete/" + data})
}